<%@ page import="com.summer.pojo.User" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java"  isELIgnored="false" %>
<%
    User user= (User) request.getSession().getAttribute("user");
%>
<html>
<head>
    <title>书籍列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/main.css"/>
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.12.4.min.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/static/js/layer/layer.js"></script>
</head>
<body>
<div class="topbar-wrap white" >
    <div class="topbar-inner clearfix">
        <div class="topbar-logo-wrap clearfix">
            <h1 class="topbar-logo none"><a href="index.html" class="navbar-brand">后台管理</a></h1>
            <ul class="navbar-list clearfix">
                <li><a class="on" href="">首页</a></li>
                <li><a href="#" target="_blank">网站首页</a></li>
            </ul>
        </div>
        <div class="top-info-wrap">
            <ul class="top-info-list clearfix">
                <li><a href="#"><%=user.getUsername()%></a></li>
                <li><a href="${pageContext.request.contextPath}/updateUserPS">修改密码</a></li>
                <li><a href="${pageContext.request.contextPath}/order/userOrder?uid=<%=user.getId()%>">我的订单</a></li>
                <li><a href="${pageContext.request.contextPath}/login/userout" onclick="exit()">退出</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="container">
    <div class="row ">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>书籍列表 —— 显示所有书籍</small>
                </h1>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4 column">
<%--            <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/toAddBook">新增</a>--%>
        </div>
    </div>
    <div class="row ">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>书籍编号</th>
                    <th>书籍名字</th>
                    <th>书籍作者</th>
                    <th>书籍价格</th>
                    <th>书籍数量</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach var="book" items="${list}">
                    <tr>
                        <td>${book.bookid}</td>
                        <td>${book.bookname}</td>
                        <td>${book.bookauthor}</td>
                        <td>${book.bookprice}</td>
                        <td>${book.bookcount}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/book/userfindBookById?bookid=${book.bookid}">订购</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
</div>
<script>
    function exit() {
        alert("确定要退出吗?");

    }
</script>